package com.goodmean.teacher.admin;

import com.goodmean.common.model.ClazzCourse;

import java.util.List;

public class ClazzCourseService {
    public static final ClazzCourseService me = new ClazzCourseService();
    private static final ClazzCourse clazzCourseDao = new ClazzCourse();

    public List <ClazzCourse> findByTeacherId(Integer teacherId) {

        return clazzCourseDao.find("SELECT * FROM clazz_course WHERE teacher_id = ?", teacherId);
    }

    public List <ClazzCourse> findByClazzId(Integer clazz_id) {
        return clazzCourseDao.find("SELECT * FROM clazz_course WHERE clazz_id = ?", clazz_id);
    }

    public ClazzCourse findByCidBid(Integer clazz_id, Integer course_id) {
        return clazzCourseDao.findFirst("SELECT * FROM clazz_course WHERE clazz_id = ? AND course_id = ?",
                clazz_id, course_id);
    }
}
